package me.zhengjie.business.service.impl;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.business.domain.Gs;
import me.zhengjie.business.domain.Sbgs;
import me.zhengjie.business.domain.sup.Gsgl;
import me.zhengjie.business.repository.GsglRepository;
import me.zhengjie.business.service.GsglService;
import me.zhengjie.business.service.dto.GsQueryCriteria;
import me.zhengjie.business.service.dto.GsglQueryCriteria;
import me.zhengjie.business.service.dto.SbgsDto;
import me.zhengjie.business.service.dto.SbgsQueryCriteria;
import me.zhengjie.utils.PageUtil;
import me.zhengjie.utils.QueryHelp;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @website https://el-admin.vip
 * @description 服务实现
 * @author xiahongbo
 * @date 2022-04-12
 **/
@Slf4j
@Service
@RequiredArgsConstructor
public class GsglServiceImpl implements GsglService {
    private final GsglRepository gsglRepository;

    @Override
    public List<Gsgl> queryAll(GsglQueryCriteria criteria){
        List<Gsgl> list = gsglRepository.findAll((root, criteriaQuery,criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder));
        return list;
    }
    @Override
    public Gsgl findByBisGsglUserId(Long bisGsglId) {
        return gsglRepository.findByBisGsglUserId(bisGsglId);
    }

    @Override
    public Gsgl queryGsgl(Long userId) {
        return gsglRepository.queryGsgl(userId);
    }


    @Override
    public Gsgl findByBisGsglId(String id) {
        return gsglRepository.findByBisGsglId(id);
    }


    @Override
    public Gsgl findByBisGsglYljgdm(String yljgdm) {
        return gsglRepository.findByBisGsglYljgdm(yljgdm);
    }

    @Override
    public List<Map<String, String>> selectInfoByWxmchidIsNotNull() {
        return gsglRepository.selectInfoByWxmchidIsNotNull();
    }
}
